fn main() {
    // println!("Hello, world!");
}

// if 控制流
#[test]
fn test_if() {
    let num = 71;
    if num < 60 {
        println!("不及格")
    } else if num < 70 {
        println!("一般")
    } else {
        println!("优秀")
    }
}


#[test]
fn test_loop() {


    // loop    死循环
    let mut count = 0;

    loop {
        count += 1;
        if count == 11 {
            break;
        }
        println!("loop-----------count: {}--------", count)
    }


    //  while  循环

    let mut count = 0;

    while count < 10 {
        count += 1;

        println!("while-----------count: {}--------", count)
    }


    //for 循环
    let array = [1, 2, 3, 34, 44, 555];

    for i in array {
        println!("i is {}", i);
    }
}




